<style>
.pageFormContent dl.notnormal div.to-date-error span.error{
    position : absolute !important;
    left : 445px;'
}
</style>
<div class="pageContent">
    <form method="post"
        class="pageForm required-validate"
        onsubmit="return validateCallback(this, dialogAjaxDone);">
        <div class="pageFormContent" layoutH="50">
            <fieldset class="dataset">
	            <dl class="nowrap notnormal">
	                    <dt><@label key="noticePeriod.C,colon">通知时段：</@label></dt>
	                    <dd>
	                       <div style="float:left;">
		                       <input name="periodStart" id="periodStart"
	                                size="32" type="text" maxlength="40" class="required date textInput"  datefmt="HH:mm:ss" readonly="true"
	                            /><a class='inputDateButton' href='javascript:;'>选择</a>
                            </div>
	                        <span style="float:left;width:30px; padding:0 5px; line-height:21px;text-align: center;"><@label key="to.C">到</@label></span>
	                        <div style="float:left;" class="to-date-error">
		                        <input name="periodEnd"  id="periodEnd"
	                                size="32" type="text" maxlength="40" class="required date textInput"  datefmt="HH:mm:ss" readonly="true"
	                            /><a class='inputDateButton' href='javascript:;'>选择</a>
                            </div>
	                    </dd>
	            </dl>
                <dl>
                    <dt><@label key="timerStartEcode.C,colon">计时起点：</@label></dt>
                    <dd>
                        <select name="timerStartEcode" class="required textInput" >
                            <#list timerStartTypeList  as timerStartType>
                            <option value="${timerStartType.eCode}">${timerStartType.eCodeText}</option>
                            </#list>
                        </select> 
                    </dd>
                </dl>
                 <dl>
                    <dt><@label key="monitorStatus.C,colon">监控状态：</@label></dt>
                    <dd>
                        <select name="statusEcode" class="textInput" >
                            <#list monitorStatusList  as monitorStatus>
                            <option value="${monitorStatus.eCode}">${monitorStatus.eCodeText}</option>
                            </#list>
                        </select> 
                    </dd>
                </dl>
                <dl class="notnormal">
                    <dt><@label key="messageReceiveUser.C,colon">消息接收人：</@label></dt>
                    <dd>
                        <input type='hidden' name='receiveUser' id="userLookUp.userCode">
                        <input name="receiveUserText"  id="userLookUp.userText" readonly="true"
                            size="32" type="text" class="required toUp look textInput"" 
                        /> 
                        <a class="btnLook" href="${rc.getContextPath()}/manage/user/userLookUp?lockFlag=0" width="1000" height="500" rel="userLookUp" lookupgroup="userLookUp" title="用户选择"></a>
                    </dd>
                </dl>
                <dl>
                    <dt><@label key="timeInterval.C,colon">升级时限：</@label></dt>
                    <dd>
                        <input name="timeInterval"
                            size="32" type="text" maxlength="10" class="required digits textInput"  style="width:50px;"
                        /> 
                        <select  name="timeInterval_timeunit" style="width:50px;margin-left:10px;" class="textInput">
                            <#list timeUnitList  as timeUnit>
                            <option value="${timeUnit.eCode}">${timeUnit.eCodeText}</option>
                            </#list>
                        </select> 
                    </dd>
                </dl>
                <dl class="notnormal">
                    <dt><@label key="messageTemplate.C,colon">消息模版：</@label></dt>
                    <dd>
                        <input type="hidden" name="messageCode" id="messageConfigLookup.messageCode" />
                        <input name="messageCodeText" id="messageConfigLookup.messageText"
                            size="32" type="text" class="required toUp look textInput" readonly="true" 
                        /> 
                        <a class="btnLook" href="${rc.getContextPath()}/manage/message/messageConfigLookUp?lockFlag=0" width="1000" height="500" rel="messageConfigLookUp" lookupgroup="messageConfigLookup" title="消息模版选择"></a>
                    </dd>
                </dl>
            </fieldset>
        </div>
        <div class="formBar">
            <ul>
                <li>
                    <div class="buttonActive">
                        <div class="buttonContent">
                            <button type="button" name="btnSave"><@label
                                key="save.B">保存</@label></button>
                        </div>
                    </div>
                    <div class="buttonActiveGrey" style="margin-left: 10px;">
                        <div class="buttonContent">
                            <button type="button" class="close"><@label
                                key="cancel.B">取消</@label></button>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
    </form>
</div>
<script type="text/javascript">
(function($){
    var page = DWZ.context();
    var timeUnit = {
    		"SECOND" : 1,
    		"MINUTE" : 60,
    		"HOUR" : 3600
    }
    $("button[name='btnSave']",page).on("click",function(){
    	var page = DWZ.context();
    	var form = $("form",page);

        if (!form.valid()) {
            return false;
        }
        
        datas = form.serializeArray();
        var data = {};
        $.each(datas,function(index,obj){
        	obj["value"] =  obj["value"] || '';
        	data[obj["name"]] = obj["value"];
        })
        
        data["timerStartEcodeText"] = $("select[name='timerStartEcode'] > option:selected",form).html();
        data["statusEcodeText"] = $("select[name='statusEcode'] > option:selected",form).html();
        data["timeInterval"] = parseFloat(data["timeInterval"]) * timeUnit[$("select[name='timeInterval_timeunit']").val()];
        data["timeIntervalText"] = data["timeInterval"]+'<@label key="second.C">秒</@label>';
        
        $.pdialog.closeCurrent();
        
        $.messageRule.bringBackToRuleItemGrid(data);
    })
    
    
})(jQuery);
</script>